<?php

namespace app\modules\admin\models;

use Yii;

/**
 * This is the model class for table "dictionary_model".
 *
 * @property int $id 自增id
 * @property int $pid 父级模型
 * @property string $dictionary_name 字段名称
 * @property string $dictionary_value 字段
 * @property int $deleted 是否删除
 * @property string $created 创建时间
 * @property string $modified 修改时间
 * @property string $post_add_template 添加文档模版
 */
class DictionaryModel extends BaseModel
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'dictionary_model';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['pid', 'deleted'], 'integer'],
            [['dictionary_name'], 'required'],
            [['created', 'modified'], 'safe'],
            [['dictionary_name', 'dictionary_value'], 'string', 'max' => 50],
            [['post_add_template'], 'string', 'max' => 20],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', '自增id'),
            'pid' => Yii::t('app', '父级模型'),
            'dictionary_name' => Yii::t('app', '字段名称'),
            'dictionary_value' => Yii::t('app', '字段'),
            'deleted' => Yii::t('app', '是否删除'),
            'created' => Yii::t('app', '创建时间'),
            'modified' => Yii::t('app', '修改时间'),
            'post_add_template' => Yii::t('app', '添加文档模版'),
        ];
    }
}
